package com.xmz.cacheaside.thread;

import com.xmz.cacheaside.request.Request;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Callable;

public class RequestThread implements Callable {
    private ArrayBlockingQueue<Request> queue;

    public RequestThread(ArrayBlockingQueue queue) {
        this.queue = queue;
    }

    @Override
    public Object call() throws Exception {
        while (true){
            Request request = queue.take();
            request.process();
        }

    }
}
